package com.spring.utils.api_v4.controller.ui;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.spring.utils.api_v4.util.DoubleSerialize;
import lombok.Data;
import lombok.ToString;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 * 工资任务
 */
@Data
@ToString
public class WageTaskItem {
    private int id;                 // 编号
    private String name;            // 名称
    private String taskType;        // 类型
    private int state = 0;          // 状态
    @JsonSerialize(using = DoubleSerialize.class)
    private double totalWage = 0;   // 绩效总额
    private LocalDate createTime;   // 创建时间
    private int deptTaskCount;      // 部门任务数量
    private int finishedTaskCount;  // 完成设置的部门任务数量
    private String note;            // 说明
    private List<DeptWageTaskItem> deptWageTaskItems;   // 部门任务列表

    public String getStateName() {
        switch (state) {
            case -1: return "锁定";
            case 0: return "未发布";
            case 1: return "发布中";
            case 2: return "已结束";
            default: return "异常";
        }
    }
}
